package com.kaishengit.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.kaishengit.dao.core.BaseDao;
import com.kaishengit.pojo.Tag;
import com.kaishengit.pojo.User;

@Repository
public class TagDao  extends BaseDao<Tag,Integer>{
	@SuppressWarnings("unchecked")
	public List<Tag> findTagsByUser(User u) {
		Criteria cri = getSession().createCriteria(Tag.class);
		cri.add(Restrictions.eq("userid", u.getId()));
		
		return cri.list();
	}
}
